package com.electric.qrapp.utils.system

import android.content.Context
import android.os.Looper
import android.util.Log
import android.widget.Toast
import com.electric.qrapp.BuildConfig
import com.electric.qrapp.ui.base.act.QRApp

/**
 *@author created by WA03675
 *@date  2021-08-02 13:48
 *@des 弹窗类
 */

fun showToast(context: Context? = null, msg: String?) {
    try {
        Toast.makeText(context ?: QRApp.app, msg, Toast.LENGTH_SHORT).show()
    } catch (e: Exception) {
        Looper.prepare();
        Toast.makeText(context ?: QRApp.app, msg, Toast.LENGTH_SHORT).show()
        Looper.loop();
    }catch (e:Exception){

    }

}

fun showLog(msg: String?) {
    if (BuildConfig.DEBUG) {
        Log.d("QRApp", msg ?: "空的~~")
    }
}